//
//  VipPopView.m
//  markmap
//
//  Created by 甘世清 on 2024/6/16.
//

#import "VipPopView.h"
#import "MyVipViewController.h"
@implementation VipPopView
+(void)SQ_showVipPopView{
    VipPopView * vc = [[VipPopView alloc]initWithFrame:CGRectMake(0, 0, 300, 430)];
    LSTPopView * pop = [LSTPopView initWithCustomView:vc
                                             parentView:nil
                                               popStyle:LSTPopStyleSmoothFromBottom dismissStyle:LSTDismissStyleScale];
    pop.hemStyle = LSTHemStyleCenter;
  
    [pop pop];
    LSTPopViewWK(pop)
    [pop setBgClickBlock:^{
        [wk_pop dismiss];
    }];
    [vc.rightBtn setTouchBlock:^(SQCustomButton * _Nonnull button) {
        [wk_pop dismiss];
        MyVipViewController * vc = [[MyVipViewController alloc]init];
        [[Manager SQ_getCurrentViewController].navigationController pushViewController:vc animated:YES];
    }];
}
- (void)SQ_UIViewForSelfView{
    UIImageView * image = [[UIImageView alloc]init];
    image.image = SQGetImage(@"VIP 背景");
    [self addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self);
    }];
    
    
    UILabel * message = [[UILabel alloc]init];
    message.text = SQNSLocalString(@"尊敬的用户：\n 您好！要使用此功能，您需要成为我们的VIP用户。成为VIP用户将为您提供更优质的服务和更丰富的体验。请您登录账户，按照相关指引升级为VIP用户，享受更多特权。感谢您的支持与理解！");
    message.numberOfLines = 0;
    message.textColor = SQColor666666;
    message.font=FONT_REGULAR(15);
    [self addSubview:message];
    [message mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(37);
            make.right.equalTo(self.mas_right).offset(-37);
            make.top.equalTo(self).offset(140);
    }];
    message.characterSpace = 2;
    message.lineSpace = 8;
    [message getLableSizeWithMaxWidth:SCREEN_WIDETH-104];
    
    [self addSubview:self.rightBtn];
    [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(220);
        make.height.mas_equalTo(40);
        make.bottom.equalTo(self.mas_bottom).offset(-28);
        make.centerX.equalTo(self);
    }];
}

- (SQCustomButton *)rightBtn{
    if (!_rightBtn) {
        _rightBtn = [[SQCustomButton alloc]initType:SQCustomButtonTopImageType imageSize:CGSizeMake(0, 0) midmargin:0];
        _rightBtn.text = SQNSLocalString(@"立即升级vip");
        _rightBtn.font = FONT_MEDIUM(15);
        _rightBtn.SQBackimageView.image = SQGetImage(@"矩形");
        _rightBtn.SQBackimageView.contentMode = UIViewContentModeScaleAspectFill;
        _rightBtn.layer.cornerRadius = 8;
        _rightBtn.textColor = UIColor.whiteColor;
    }
    return _rightBtn;
}

@end
